package com.cn.xiaonuo.slbfinances.payconfig.controller;

import com.cn.xiaonuo.common.entity.BusinessMessage;
import com.cn.xiaonuo.slbfinances.payconfig.entity.SlPayChannel;
import com.cn.xiaonuo.slbfinances.payconfig.param.SlPayChannelParam;
import com.cn.xiaonuo.slbfinances.payconfig.service.SlbPayChannelService;
import com.cn.xiaonuo.tcrfinance.payconfig.param.PayChannelParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: slb-reports-java
 * @Author: likui
 * @CreateTime: 2022-09-21  13:23
 * @Description: 支付渠道相关接口
 */
@RestController
public class SlPayChannelController {

    @Autowired
    private SlbPayChannelService slbPayChannelService;

    @ApiOperation(value = "支付渠道列表", notes = "支付渠道列表")
    @PostMapping("/api/slbPayType/pagePayChannel")
    public BusinessMessage pagePayChannel(@RequestBody SlPayChannelParam param){
        BusinessMessage message =slbPayChannelService.pagePayChannel(param);
        return message;
    }

    @ApiOperation(value = "添加支付渠道", notes = "添加支付渠道")
    @PostMapping("/api/slbPayType/addPayChannel")
    public BusinessMessage addPayChannel(@RequestBody SlPayChannel param){
        BusinessMessage message =slbPayChannelService.addPayChannel(param);
        return message;
    }

    @ApiOperation(value = "编辑支付渠道", notes = "编辑支付渠道")
    @PostMapping("/api/slbPayType/updatePayChannel")
    public BusinessMessage updatePayChannel(@RequestBody SlPayChannel param){
        BusinessMessage message =slbPayChannelService.updatePayChannel(param);
        return message;
    }

    @ApiOperation(value = "删除支付渠道", notes = "删除支付渠道")
    @PostMapping("/api/slbPayType/deletePayChannel")
    public BusinessMessage deletePayChannel(Integer id){
        BusinessMessage message =slbPayChannelService.deletePayChannel(id);
        return message;
    }

    @ApiOperation(value = "支付渠道详情", notes = "支付渠道详情")
    @PostMapping("/api/slbPayType/payChannelDetail")
    public BusinessMessage payChannelDetail(Integer id){
        BusinessMessage message =slbPayChannelService.payChannelDetail(id);
        return message;
    }

    @ApiOperation(value = "支付渠道状态修改", notes = "支付渠道状态修改")
    @PostMapping("/api/slbPayType/updatePayChannelState")
    public BusinessMessage updatePayChannelState(@RequestBody PayChannelParam param){
        BusinessMessage message =slbPayChannelService.updatePayChannelState(param);
        return message;
    }
}
